<!DOCTYPE>
{extend name="default/base" /}
{block name="title"}{$data['shop']['shopName']} - {:WSTConf('CONF.mallName')}{__block__}{/block}
<meta name="description" content="{$data['shop']['shopDesc']},{:WSTConf('CONF.mallName')}">
<meta name="Keywords" content="{$data['shop']['shopKeywords']},{:WSTConf('CONF.mallName')}">
{block name="css"}
<link href="__STATIC__/plugins/lazyload/skin/laypage.css?v={$v}" rel="stylesheet">
<link href="__STATIC__/plugins/slide/css/slide.css?v={$v}" rel="stylesheet">
<link href="__STYLE__/css/shophome.css?v={$v}" rel="stylesheet">
<style type="text/css">
</style>
{/block}
{block name="header"}
    {php}$shopId = $data['shop']['shopId'];{/php}
    <input type="hidden" id="longitude" value="{$data['shop']['longitude']}" >
    <input type="hidden" id="latitude" value="{$data['shop']['latitude']}" >
	<div class="wst-container">
		<div class="wst-shop-h">
		<div class="wst-shop-img"><a href="{:url('home/shops/index',array('shopId'=>$data['shop']['shopId']))}"><img class="shopsImg" data-original="__RESOURCE_PATH__/{$data['shop']['shopImg']}" title="{$data['shop']['shopName']}"></a></div>
		<div class="wst-shop-info">
			<p>{$data['shop']['shopName']}
				{/* 在线客服 */}
        		{:hook('homeDocumentContact',['type'=>'shopHome','shopId'=>$data['shop']['shopId']])}
			</p>
			<div class="wst-shop-info2">
			{volist name="$data['shop']['accreds']" id="ac"}
			<img src="__RESOURCE_PATH__/{$ac['accredImg']}"><span>{$ac['accredName']}</span>
			{/volist}
			{if($data['shop']['shopQQ'])}
			<a href="tencent://message/?uin={$data['shop']['shopQQ']}&Site=QQ交谈&Menu=yes">
		        <img border="0" style="width:65px;height:24px;" src="{:WSTProtocol()}wpa.qq.com/pa?p=1:{$data['shop']['shopQQ']}:7">
		    </a>
			{/if}
			{if($data['shop']['shopWangWang'])}
			<a href="{:WSTProtocol()}www.taobao.com/webww/ww.php?ver=3&touid={$data['shop']['shopWangWang']}&siteid=cntaobao&status=1&charset=utf-8" target="_blank">
			<img border="0" src="{:WSTProtocol()}amos.alicdn.com/realonline.aw?v=2&uid={$data['shop']['shopWangWang']}&site=cntaobao&s=1&charset=utf-8" alt="和我联系" class='wangwang'/>
			</a>
			{/if}
			</div>
			<div class="wst-shop-info3">
				<span class="wst-shop-eva">商品评价：<span class="wst-shop-red">{$data['shop']['scores']['goodsScore']}</span></span>
				<span class="wst-shop-eva">时效评价：<span class="wst-shop-red">{$data['shop']['scores']['timeScore']}</span></span>
				<span class="wst-shop-eva">服务评价：<span class="wst-shop-red">{$data['shop']['scores']['serviceScore']}</span></span>
				{if($data['shop']['isfollow']>0)}
				<a href='javascript:void(0);' onclick='cancelFavorite(this,1,{$data['shop']['shopId']},{$data['shop']['isfollow']})' class="wst-shop-evaa j-fav">已关注</a>
				{else}
				<a href='javascript:void(0);' onclick='addFavorite(this,1,{$data['shop']['shopId']},{$data['shop']['isfollow']})' class="wst-shop-evaa j-fav2">关注店铺</a>
				{/if}
                {if($data['shop']['longitude'] && $data['shop']['latitude'])}
				<a href='javascript:void(0);' onclick='javascript:init();' class="wst-shop-evaa  wst-shop-location j-fav3">店铺位置</a>
                {/if}
				<span class="wst-shop-eva">用手机逛本店  &nbsp;&nbsp;|</span>
				<a class="wst-shop-code"><span class="wst-shop-codes hide"><div id='qrcode' style='width:142px;height:142px;'></div></span></a>
			</div>
		</div>
		<div class="wst-shop-sea">
			<input type="text" id="goodsName" value="" placeholder="输入商品名称">
			<a class="search" href="javascript:void(0);" onclick="javascript:WST.goodsSearch($('#goodsName').val());">搜全站</a>
			<a class="search" href="javascript:void(0);" onclick="javascript:searchShopsGoods(0);">搜本店</a>
			<div class="wst-shop-word">
			{volist name="data['shop']['shopHotWords']" id="shw"}
			<a href='{:Url("home/shops/index",array('shopId'=>$data['shop']['shopId'],'goodsName'=>$shw))}'>{$shw}</a>{if $i< count($data['shop']['shopHotWords'])}&nbsp;|&nbsp;{/if}
			{/volist}
			</div>
			<?php if(!(Request()->isSsl())){?>
		      	<div style="clear: both;"></div>
		      	<div class="bshare-custom icon-medium-plus">
		          <a title="分享到QQ空间" class="bshare-qzone"></a>
		          <a title="分享到新浪微博" class="bshare-sinaminiblog"></a>
		          <a title="分享到QQ好友" class="bshare-qqim"></a>
		          <a title="分享到微信" class="bshare-weixin"></a>
		        </div>
		        <script type="text/javascript" charset="utf-8" src="http://static.bshare.cn/b/buttonLite.js#style=-1&pophcol=2&lang=zh"></script>
		        <script type="text/javascript" charset="utf-8" src="http://static.bshare.cn/b/bshareC0.js"></script>
		    <?php } ?>
			{:hook('homeDocumentShopHomeHeader',['shop'=>$data['shop'],'getParams'=>input()])}
			<div style="clear: both;"></div>
		</div>
		<div class="wst-clear"></div>
		</div>
	</div>
	{if($data['shop']['shopBanner'])}<image class="wst-shop-tu" src="__RESOURCE_PATH__/{$data['shop']['shopBanner']}"></image>{/if}
	 <div class='wst-header'>
		<div class="wst-shop-nav">
			<div class="wst-nav-box">
				<a href="{:url('home/shops/index',array('shopId'=>$data['shop']['shopId']))}"><li class="liselect wst-lfloat">本店全部商品</li></a>
				{wst:shopcats shop="$shopId" id="sc" num='8'}
					<a href="{:url('home/shops/goods',array('shopId'=>$sc['shopId'],'ct1'=>$sc['catId']))}"><li class="liselect wst-lfloat">{$sc['catName']}</li></a>
				{/wst:shopcats}
				<a class="homepage" href='{$Request.root.true}'>返回商城首页</a>
				<div class="wst-clear"></div>
			</div>
		</div>
		<div class="wst-clear"></div>
	</div>
	{if($data['shop']['shopAds'])}
	<div class="ck-slide">
		<ul class="ck-slide-wrapper">
			{volist name="$data['shop']['shopAds']" id="ads"}
			<li>
				<a {if ($ads['isOpen'])}target='_blank'{/if}  href="{$ads['adUrl']}" ><img class='goodsImg' data-original="__RESOURCE_PATH__/{$ads['adImg']}" width="100%" height="400"/></a>
			</li>
			{/volist}
		</ul>
		<div class="ck-slidebox">
			<div class="slideWrap">
				<ul class="dot-wrap">
				{volist name="$data['shop']['shopAds']" id="ads" key="i"}
					{if condition="$i eq 1"}
						<li class="current"><em>{$i}</em></li>
					{else}
						<li><em>{$i}</em></li>
					{/if}
				{/volist}
				</ul>
			</div>
		</div>
	</div>
	{/if}
{/block}
{block name="main"}
<input type="hidden" id="msort" value="{$msort}" autocomplete="off"/>
<input type="hidden" id="mdesc" value="{$mdesc}" autocomplete="off"/>
<input type="hidden" id="shopId" value="{$data['shop']['shopId']}" autocomplete="off"/>
<input type="hidden" id="ct1" value="{$ct1}" autocomplete="off"/>
<input type="hidden" id="ct2" value="{$ct2}" autocomplete="off"/>
<div class="wst-container">
	<div class="wst-shop-contl">
		{if(strlen($data['shop']['shopNotice'])>0)}
		<div class="wst-shop-cat">
			<p class="wst-shop-conlp">
				<img src="__STYLE__/img/notice.png" class="notice_img" />
				店铺公告
			</p>
			<div class="wst-shop-catt" style="padding:5px 10px;">
				{$data['shop']['shopNotice']}
			</div>
		</div>
		{/if}
		<div class="wst-shop-cat">
			<p class="wst-shop-conlp">店铺分类</p>
			<div class="wst-shop-catt">
			{wst:shopcats shop="$shopId" id="sc1"}
				<li onclick="javascript:dropDown(this,{$sc1['catId']});" class="js-shop-plus">{:WSTMSubstr($sc1['catName'],0,15)}</li>
				<div class="wst-shop-catts tree_{$sc1['catId']}">
				{wst:shopcats shop="$shopId" cat="$sc1['catId']" id="sc2"}
					<a href="{:url('home/shops/goods',array('shopId'=>$sc1['shopId'],'ct1'=>$sc1['catId'],'ct2'=>$sc2['catId']))}"><li>{:WSTMSubstr($sc2['catName'],0,15)}</li></a>
				{/wst:shopcats}
				</div>
			{/wst:shopcats}
			</div>
		</div>
		<div class="wst-shop-best">
			<p class="wst-shop-conlp">热卖商品</p>
			{wst:shopgoods type='hot' num='5' id='ho' shop="$data['shop']['shopId']"}
			<a href="{:url('home/goods/detail',array('goodsId'=>$ho['goodsId']))}" target="_blank">
			<div class="wst-shop-bestg">
				<div class="wst-shop-besti"><img class="goodsImg" data-original="__RESOURCE_PATH__/{$ho['goodsImg']}" title="{$ho['goodsName']}" alt="{$ho['goodsName']}"></div>
				<a href="{:url('home/goods/detail',array('goodsId'=>$ho['goodsId']))}"><p class="wst-shop-bestgp1">{:WSTMSubstr($ho['goodsName'],0,20)}</p></a>
				<p class="wst-shop-bestgp2">已售出<span class="wst-shop-bestpi">{$ho['saleNum']}</span>件</p>
				<p class="wst-shop-bestgp2"><span class="wst-shop-bestpr">￥{$ho['shopPrice']}</span><span class="wst-shop-bestpr2">￥{$ho['marketPrice']}</span></p>
			</div>
			</a>
			{/wst:shopgoods}
			<div class="wst-clear"></div>
		</div>
		{if cookie("history_goods")!=''}
		<div class="wst-shop-lat">
			<p class="wst-shop-conlp">最近浏览</p>
			{wst:goods type='history' num='4'}
			<div class="wst-shop-bestg">
				<div class="wst-shop-besti"><a target='_blank' href="{:Url('home/goods/detail','goodsId='.$vo['goodsId'])}"><img class="goodsImg" data-original="__RESOURCE_PATH__/{:WSTImg($vo['goodsImg'])}" title="{$vo['goodsName']}" alt="{$vo['goodsName']}" ></div>
				<a href="{:url('home/goods/detail','goodsId='.$vo['goodsId'])}" target='_blank'><p class="wst-shop-bestgp1">{$vo['goodsName']}</p></a>
				<p class="wst-shop-bestgp2">已售出<span class="wst-shop-bestpi">{$vo['saleNum']}</span>件</p>
				<p class="wst-shop-bestgp2"><span class="wst-shop-bestpr">￥{$vo['shopPrice']}</span><span class="wst-shop-bestpr2">￥{$vo['marketPrice']}</span></p>
			</div>
			{/wst:goods}
			<div class="wst-clear"></div>
		</div>
		{/if}
	</div>
	<div class="wst-shop-contr">
		<div class="wst-shop-rec">
			<p class="wst-shop-conrp">店长推荐</p>
			<div class="wst-shop-recb">
			    {wst:shopgoods type='recom' num='4' id='re' shop="$data['shop']['shopId']"}
				<div class="wst-shop-rgoods">
					<div class="wst-shop-goimg"><a href="{:url('home/goods/detail',array('goodsId'=>$re['goodsId']))}" target="_blank"><img class="goodsImg" data-original="__RESOURCE_PATH__/{$re['goodsImg']}" title="{$re['goodsName']}"></a></div>
					<p class="wst-shop-gonam"><a href="{:url('home/goods/detail',array('goodsId'=>$re['goodsId']))}" target="_blank">{:WSTMSubstr($re['goodsName'],0,28)}</a></p>
					<div class="wst-shop-rect">
					<span>￥{$re['shopPrice']}</span>
					{if($re['goodsStock'])}
					<a class="wst-shop-recta" href="javascript:addCart({$re['goodsId']})">加入购物车</a>
					{else}
					<a class="wst-shop-recta2" href="javascript:void(0);">暂无商品</a>
					{/if}
					</div>
				</div>
			    {/wst:shopgoods}
				<div class="wst-clear"></div>
			</div>
		</div>
		<div class="wst-shop-list">
			<div class="wst-shop-listh">
				<a href="javascript:void(0);" class="{if condition="$msort eq 0"}wst-shop-a{/if}" onclick="searchShopsGoods(0);">综合排序</a>
				<a href="javascript:void(0);" class="{if condition="$msort eq 1"}wst-shop-a{/if}" onclick="searchShopsGoods(1);">人气<span class="{if condition="$msort neq 1"}wst-shop-store{/if}{if condition="$msort eq 1 and $mdesc eq 1"}wst-shop-store2{/if}{if condition="$msort eq 1 and $mdesc eq 0"}wst-shop-store3{/if}"></span></a>
				<a href="javascript:void(0);" class="{if condition="$msort eq 2"}wst-shop-a{/if}" onclick="searchShopsGoods(2);">销量<span class="{if condition="$msort neq 2"}wst-shop-store{/if}{if condition="$msort eq 2 and $mdesc eq 1"}wst-shop-store2{/if}{if condition="$msort eq 2 and $mdesc eq 0"}wst-shop-store3{/if}"></span></a>
				<a href="javascript:void(0);" class="{if condition="$msort eq 3"}wst-shop-a{/if}" onclick="searchShopsGoods(3);">价格<span class="{if condition="$msort neq 3"}wst-shop-store{/if}{if condition="$msort eq 3 and $mdesc eq 1"}wst-shop-store2{/if}{if condition="$msort eq 3 and $mdesc eq 0"}wst-shop-store3{/if}"></span></a>
				<a href="javascript:void(0);" class="{if condition="$msort eq 5"}wst-shop-a{/if}" onclick="searchShopsGoods(5);">好评度<span class="{if condition="$msort neq 5"}wst-shop-store{/if}{if condition="$msort eq 5 and $mdesc eq 1"}wst-shop-store2{/if}{if condition="$msort eq 5 and $mdesc eq 0"}wst-shop-store3{/if}"></span></a>
				<a href="javascript:void(0);" class="{if condition="$msort eq 6"}wst-shop-a{/if}" onclick="searchShopsGoods(6);">上架时间<span class="{if condition="$msort neq 6"}wst-shop-store{/if}{if condition="$msort eq 6 and $mdesc eq 1"}wst-shop-store2{/if}{if condition="$msort eq 6 and $mdesc eq 0"}wst-shop-store3{/if}"></span></a>
				<div class="wst-price-ipts">
				<span class="wst-price-ipt1">￥</span><span class="wst-price-ipt2">￥</span>
				<input type="text" class="wst-price-ipt" id="sprice" value="{$sprice}" style="margin-left:8px;" onkeypress='return WST.isNumberdoteKey(event);' onkeyup="javascript:WST.isChinese(this,1)">
				- <input type="text" class="wst-price-ipt" id="eprice" value="{$eprice}" onkeypress='return WST.isNumberKey(event);' onkeyup="javascript:WST.isChinese(this,1)">
				</div>
				<button class="wst-shop-but" type="submit" style="width:60px;height: 33px;" onclick="searchShopsGoods(0);">确定</button>
			</div>
			<div class="wst-clear"></div>
			<div class="wst-shop-listg">
				{volist name="$data['list']['data']" id="li"}
				<div class="wst-shop-goods">
					<div class="wst-shop-goimg"><a href="{:url('home/goods/detail',array('goodsId'=>$li['goodsId']))}" target="_blank"><img class="goodsImg" data-original="__RESOURCE_PATH__/{$li['goodsImg']}" title="{$li['goodsName']}"></a><a href="javascript:addCart({$li['goodsId']});"><span class="js-cart">加入购物车</span></a></div>
					<p class="wst-shop-gonam"><a href="{:url('home/goods/detail',array('goodsId'=>$li['goodsId']))}" target="_blank">{:WSTMSubstr($li['goodsName'],0,15)}</a></p>
					<p class="wst-shop-goodp1"><span class="wst-shop-goodpr">￥{$li['shopPrice']}</span><span class="wst-rfloat">成交数：<span class="wst-shop-goodpr2">{$li['saleNum']}</span></span></p>
					<p class="wst-shop-goodp2"><span class="wst-shop-goodpr3">市场价:￥{$li['marketPrice']}</span><span class="wst-rfloat">已有<span class="wst-shop-goodpr4">{$li['appraiseNum']}</span>人评价</span></p>
				</div>
				{/volist}
				<div class="wst-clear"></div>
			</div>
			<div class="wst-shop-pa">
				<div id="shopPage"></div>
			</div>
		</div>
	</div>
	<div class="wst-clear"></div>

    <div id="container" class="container" style='display:none'></div>
</div>
{include file="default/right_cart"/}
{/block}
{block name="js"}
<script type="text/javascript" src="__STATIC__/plugins/slide/js/slide.js?v={$v}"></script>
<script type='text/javascript' src='__STYLE__/js/shophome.js?v={$v}'></script>
<script type='text/javascript' src='__STYLE__/js/qrcode.js?v={$v}'></script>
<script type="text/javascript" src="{:WSTProtocol()}map.qq.com/api/js?v=2.exp&key={:WSTConf('CONF.mapKey')}"></script>
<script>
$(function(){
	$(document).keypress(function(e) { 
          if(e.which == 13) {  
            searchShopsGoods();  
          }
    }); 
	if({$data['list']['last_page']}>1){
	laypage({
	    cont: 'shopPage',
	    pages: {$data['list']['last_page']}, //总页数
	    curr: {$data['list']['current_page']},
	    skip: true, //是否开启跳页
	    skin: '#fd6148',
	    groups: 3, //连续显示分页数
	   	prev: '<<',
		next: '>>',
	    jump: function(e, first){ //触发分页后的回调
	        if(!first){ //一定要加此判断，否则初始时会无限刷新
	        	var nuewurl = WST.splitURL("page");
	        	var ulist = nuewurl.split("?");
	        	if(ulist.length>1){
	        		location.href = nuewurl+'&page='+e.curr;
	        	}else{
	        		location.href = '?page='+e.curr;
	        	}
	            
	        }
	    }
	});
	}
	var qr = qrcode(10, 'H');
	var url = '{:url("mobile/shops/index",array("shopId"=>$data["shop"]["shopId"]),true,true)}';
	qr.addData(url);
	qr.make();
	$('#qrcode').html(qr.createImgTag());
	var width = $(window).width();
	$('.wst-shop-tu').css('width',width);
});
</script>
{/block}
{block name="footer"}{__block__}
{/block}